package owl2vowl.parser.vowl;

import owl2vowl.constants.VowlAttribute;
import owl2vowl.model.entities.nodes.classes.VowlClass;
import owl2vowl.model.entities.nodes.classes.VowlThing;
import owl2vowl.model.entities.nodes.datatypes.VowlDatatype;
import owl2vowl.model.entities.nodes.datatypes.VowlLiteral;
import owl2vowl.model.entities.properties.TypeOfProperty;
import owl2vowl.model.entities.properties.VowlDatatypeProperty;
import owl2vowl.model.entities.properties.VowlObjectProperty;
import owl2vowl.model.individuals.VowlIndividual;
import owl2vowl.model.visitor.VowlElementVisitor;
import java.util.Collection;

public class TypeSetter implements VowlElementVisitor {
	public void visit(VowlThing vowlThing) {
	}

	public void visit(VowlClass vowlClass) {
		vowlClass.setType(this.getClassType(vowlClass.getAttributes()));
	}

	public void visit(VowlLiteral vowlLiteral) {
	}

	public void visit(VowlDatatype vowlDatatype) {
	}

	public void visit(VowlObjectProperty vowlObjectProperty) {
	}

	public void visit(VowlDatatypeProperty vowlDatatypeProperty) {
	}

	public void visit(VowlIndividual vowlIndividual) {
	}

	public void visit(TypeOfProperty typeOfProperty) {
	}

	protected String getClassType(Collection<VowlAttribute> attributes) {
		return attributes.contains(VowlAttribute.INTERSECTION)
				? "owl:intersectionOf"
				: (attributes.contains(VowlAttribute.UNION)
						? "owl:unionOf"
						: (attributes.contains(VowlAttribute.COMPLEMENT)
								? "owl:complementOf"
								: (attributes.contains(VowlAttribute.DISJOINTUNION)
										? "owl:disjointUnionOf"
										: (attributes.contains(VowlAttribute.EQUIVALENT)
												? "owl:equivalentClass"
												: (attributes.contains(VowlAttribute.RDF)
														? "rdfs:Class"
														: "owl:Class")))));
	}
}